<template>
  <div class="playerInfo">
    <p>世界种子：{{ mapSeed }}</p>
    <p>坐标：({{ player.x }}, {{ player.y }})</p>
    <p>时间：{{ gameTime }}</p>
  </div>
</template>

<script>
import { mapState } from "vuex";
import { getTimeByMin } from "@/util/time.js";

export default {
  computed: {
    ...mapState("map", ["player", "mapSeed", "mapTime"]),
    gameTime() {
      let time = getTimeByMin(this.mapTime);
      return `第${time.d}天 ${time.h}:${time.m}`;
    },
  },
};
</script>

<style scoped>
.playerInfo {
  position: fixed;
  color: #fff;
  background: rgb(80, 80, 80);
  left: 10px;
  top: 10px;
  width: auto;
  height: auto;
  padding: 10px;
  border-radius: 10px;
}
</style>